'use strict';

var zixysMarker = function(pad,pageX,$scope){
    this.pad = pad;
    this.$scope = $scope;
    this.node = $('<div class="zixys-marker">\n\
                     <div class="zixys-marker-color"></div>\n\
                  </div>');
    this.handle = this.node.children();
    this.doc = $(document);
    this.bindDraggables();
    this.pad.append(this.node);
    this.scale = this.pad.innerWidth();
    this.output = {
        position: this.calcRelativePosition(pageX),
        rgb:{
            r:0,
            g:0,
            b:0
        },
        alpha:100
    };
};


zixysMarker.prototype.bindDraggables = function() {
    var self = this, pos;



};

zixysMarker.prototype.setPosition = function (pos) {
    this.output.position = pos;
    this.node[0].style.left = pos+'%';
};

zixysMarker.prototype.setColor = function (rgb, alpha) {
    this.output.rgb = rgb;
    this.output.alpha = alpha;
};

zixysMarker.prototype.activate = function () {
    this.node.addClass('zixys-selected-marker');
};

zixysMarker.prototype.deactivate = function () {
    this.node.removeClass('zixys-selected-marker');
};

zixysMarker.prototype.removeNode = function () {
    this.node.remove();
}